package cn.tedu._03mybatis.mapper;

import cn.tedu._03mybatis.pojo.entity.Weibo;
import cn.tedu._03mybatis.pojo.vo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@SuppressWarnings("all")

@Mapper
public interface WeiboMapper {
//
//    @Insert("insert into weibo(content,created,user_id) values " +
//            "(#{content},#{created},#{userId})")
    void insertWeibo(Weibo weibo);

//    @Delete("delete from weibo where id = #{wid}")
    int deleteWeibo(Long wid);


//    @Update("update weibo set content = #{content},created = #{created} where id = #{id}")
    int updateWeibo(Weibo weibo);

//    @Select("select id,content,created,user_id userId from weibo where id = #{id}")
    Weibo selectWeiboById(Long id);

//    @Select("select id,content,created,user_id userId from weibo where id = #{id}")
    WeiboVO1 selectWeiboById1(Long id);

//    @Select("select content,created,user_id userId from weibo where user_id = #{userId}")
    List<WeiboVO2> selectWeiboById2(Long userId);

    /**
     * 动态SQL
     */

    int updateWeiboDynamic(Weibo weibo);

    int deleteWeiboDynamic(Long[] ids);

    int deleteWeiboDynamic2(List<Long> ids);

    int countWeibo();

    ResultMapVO1 selectWeiboMap1(Long id);

    ResultMapVO2 selectWeiboMap2(Long id);

    ResultMapVO3 selectWeiboMap3(Long id);
}
